﻿#region Using directives
using System;
using System.Web;

#endregion

namespace ProcolDemo {
    public class Configuration {
        private const int DEFAULT_LANGUAGE = 1; // 1 English, 2 Spanish, 3 Deutsch

        public static int GetLanguage() {
            HttpRequest Request = HttpContext.Current.Request;

            if (Request.UserLanguages != null) {
                String firstLang = Request.UserLanguages[0];

                return firstLang.StartsWith("en") ? 1 : (firstLang.StartsWith("es") ? 2 : 3);
            }

            return DEFAULT_LANGUAGE;
        }
    }
}